//
//  PPAlbumHotTagModel.m
//  
//
//  Created by Jinxiao on 9/16/16.
//
//

#import "PPAlbumHotTagModel.h"

@implementation PPAlbumHotTagModel

// Insert code here to add functionality to your managed object subclass
+ (instancetype)existingAlbumHotTagForTagID:(NSNumber *)tagID {
    if(tagID.integerValue == 0) {
        return nil;
    }
    
    PPAlbumHotTagModel *tag = [self find:@{@"tagID" :tagID}];

    if(tag == nil) {
        tag = [PPAlbumHotTagModel create];
        tag.tagID = tagID;
        [tag.managedObjectContext saveContext];
    }

    return tag;
}

@end
